package com.atguigu.eduservice.controller;

import com.atguigu.commonutils.R;
import org.springframework.web.bind.annotation.*;

/**
 * 模拟登陆
 */
@RestController
@RequestMapping("/eduservice/user")
//@CrossOrigin //前后端分离解决跨域访问
public class EduLoginController {

    @PostMapping("/login")
    public R login(){
        return R.ok().data("token","admin");
    }

    @GetMapping("/info")
    public R info(){
        return R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1590585702&di=6edeac595b5d99ff3501476093c8ab58&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg");
    }
}
